package cn.cs.mapper;

import cn.cs.pojo.CsParts;
import cn.cs.pojo.CsPartsAttribute;
import cn.cs.pojo.CsPartsQrCode;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface CsPartsMapper {

    public CsParts getCsPartsById(@Param(value = "id") String id) throws Exception;

    public CsParts getCsPartsByName(@Param(value = "parts_name") String parts_name) throws Exception;

    public List<CsParts> getCsPartsByFactoryId(@Param(value = "factory_id") String factory_id, @Param(value = "factory_name") String factory_name, @Param(value = "parts_name") String parts_name) throws Exception;

    public List<CsParts> getCsPartsListByMap(Map<String, Object> param) throws Exception;

    public Integer getCsPartsCountByMap(Map<String, Object> param) throws Exception;

    public Integer insertCsParts(CsParts csParts) throws Exception;

    public Integer addPartsAttribute(CsPartsAttribute partsAttribute) throws Exception;

    public Integer updateCsParts(CsParts csParts) throws Exception;

    public Integer updatePartsAttribute(CsPartsAttribute partsAttribute) throws Exception;

    public Integer deleteCsPartsById(@Param(value = "id") String id) throws Exception;

    public Integer deleteCsPartsImgByPartsId(@Param(value = "partsId") String partsId) throws Exception;

    public Integer deletePartsAttribute(@Param(value = "id") String id) throws Exception;

    public Integer insertCsPartsImgList(List<Map<String, Object>> list)throws Exception;

    public Integer insertCsPartsQRcodeList(List<Map<String, Object>> list)throws Exception;

    public Integer updateCsPartsQRcode(Map<String, Object> map)throws Exception;


    public List<Map<String, Object>> getCsPartsQRcodeListByMap(Map<String, Object> param) throws Exception;

    public Integer getCsPartsQRcodeCountByMap(Map<String, Object> param) throws Exception;

    public List<Map<String, Object>> getHistoryByQRcode(String QRcode) throws Exception;

    public Map<String, Object> getPartsByQRcode(String QRcode) throws Exception;

    public List<Map<String, Object>> getPartsSellNum(Map<String, Object> param) throws Exception;

    public Integer getPartsSellNumCount(Map<String, Object> param) throws Exception;

    public Long getQrcodeMax(@Param(value = "partsId") String partsId) throws Exception;

    public List<Map<String, Object>>  getPartsQrcodeList(@Param(value = "partsId") String partsId, @Param(value = "startCode") String startCode, @Param(value = "endCode") String endCode) throws Exception;

    public List<CsPartsQrCode>  getPartsQrcodeListEntity(@Param(value = "partsId") String partsId, @Param(value = "startCode") String startCode, @Param(value = "endCode") String endCode) throws Exception;




}
